package cn.itcast.casclient.controller;

import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class UserController {
    /**获取登录用户名*/
    @GetMapping("/findLoginUser")
    public String findLoginUser(){
        String name = SecurityContextHolder.getContext().getAuthentication().getName();
        return name;
    }
}
